package com.zs.source;


import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.core.PriorityOrdered;

/**
 * @author zhshuo
 * @date 2021/07/13 15:24
 **/
public class BeanPostProcessor_1 implements BeanPostProcessor, PriorityOrdered {

	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
		System.out.println(beanName+":PriorityOrdered#1 before 执行");
		return bean;
	}

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		System.out.println(beanName+":PriorityOrdered#1 after 执行");
		return bean;
	}

	@Override
	public int getOrder() {
		return 1;
	}
}
